package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpITADPrintITADLabelsPageUtil extends SeleniumPageUtil {
	
	public final static By IIMP_SPAN_HEADER = By.id("ctl44_lblModelBoxTitle");
	public final static By IIMP_TD_WAREHOUSE = By.xpath("//*[@id='ctl44_pnlPush']/table/tbody/tr[1]/td[1]");
	public final static By IIMP_INPUT_WAREHOUSE = By.id("ctl44_txtWarehouse");
	public final static By IIMP_LABEL_PRINT_SERVER = By.xpath("//*[@id='ctl44_pnlPrint']/table/tbody/tr[1]/td[1]/label");
	public final static By IIMP_SELECT_PRINT_SERVER = By.id("ctl44_ddlPrinterServers");
	public final static By IIMP_LABEL_PRINTER = By.xpath("//*[@id='ctl44_pnlPrint']/table/tbody/tr[2]/td[1]/label");
	public final static By IIMP_SELECT_PRINTER = By.id("ctl44_ddlPrinters");
	public final static By IIMP_LINK_SAVE = By.id("ctl44_lnkSaveNewModel1");
	public final static By IIMP_LINK_CLOSE = By.id("ctl44_lnkCancelNewModel");
	
//	public static void enterPrinterITADLabelsPage(){
//		SpITADDefaultPageUtil.enterITADInventoryManagementDefaultPage();
//		SeleniumUtil.click(SeleniumUtil.getCachedElement(SpITADDefaultPageUtil.IIM_LINK_PRINT_ITAD_LABELS));
//		waitForPageToLoad();
//	}
	
	public static void waitForPageToLoad() {
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				IIMP_SELECT_PRINT_SERVER, IIMP_SELECT_PRINTER, IIMP_LINK_SAVE, IIMP_LINK_CLOSE 
			});
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(IIMP_SELECT_PRINT_SERVER));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(IIMP_SELECT_PRINTER));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(IIMP_LINK_SAVE));
		SeleniumUtil.isDisplayed(SeleniumUtil.findElement(IIMP_LINK_CLOSE));
	}
}
